import request from '/@/utils/request';

/**
 * 登录api接口集合
 * @method signIn 用户登录
 * @method signOut 用户退出登录
 */
export function useLoginApi() {
	return {
		//登录
		signIn: (params: object) => {
			return  request({
				url: '/system-admin/sys-login/login',
				method: 'post',
				data: params,
			});
		},
		//获取登录的用户信息
		getUserInfo: () => {
			return  request({
				url: '/system-admin/sys-login/getUserInfoByUserId',
				method: 'get',
			});
		},
		//获取用户按钮权限
		getBtn: () => {
			return  request({
				url: '/system-admin/sys-login/getBtnByUserId',
				method: 'get',
			});
		},
		//获取用户角色
		getRole: () => {
			return  request({
				url: '/system-admin/sys-login/getRoleByUserId',
				method: 'get',
			});
		},
		signOut: () => {
			return request({
				url: '/system-admin/sys-login/logout',
				method: 'get',
			});
		},
	};
}
